package com.jason.kotlin.gank.api

import com.jason.library.common.data.RetrofitManager

object ApiSource {

    /**
     * GanK 开放API 地址
     */
    private const val BASE_GANK_URL = "https://gank.io"

    /**
     * 心知 天气开放API 地址
     */
    private const val BASE_XIN_ZHI_URL = "https://api.seniverse.com"

    const val XIN_ZHI_APP_SECRET = "SGlQM8jGgOKvx3Xo1"

    /**
     * roll Api
     */
    private const val BASE_ROLL_TOOLS_URL = "https://www.mxnzp.com"

    const val ROLL_TOOLS_APP_ID = "limrkcszjfgxamkt"
    const val ROLL_TOOLS_APP_SECRET = "ZGVJUm5PbjJ1NFE4SjFqMzJ0STdwZz09"

    /**
     * 彩云科技 API
     */
    private const val BASE_CAI_YUN_URL = "https://api.caiyunapp.com"

    const val CAI_YUN_APP_SECRET = "pyKtcjONpEwWt6MP"

    /**
     * GanK 开放API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getGankService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_GANK_URL)


    /**
     * roll API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getRollService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_ROLL_TOOLS_URL)

    /**
     * 心知 天气开放API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getXinZhiWeatherService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_XIN_ZHI_URL)

    /**
     * 彩云 天气开放API 接口
     *
     * @param service Class<T>
     * @return T
     */
    fun <T> getCaiYunWeatherService(service: Class<T>): T =
        RetrofitManager.getService(service, BASE_CAI_YUN_URL)
}